<?php
require('../database/db.php');
$mysql=new mysql();
include("../../tool/UpFileTool.class.php");


$shopid = trim($_REQUEST[shopid]);

$address=trim($_REQUEST[address]);//地址
$longitude=trim($_REQUEST[lon]);//经度
$latitude=trim($_REQUEST[lat]);//纬度
$leimu=trim($_REQUEST[classify]);//分类
$zileimu=trim($_REQUEST[zileimu]);//子分类
$city=trim($_REQUEST[city]);//城市
$name=trim($_REQUEST[name]);//商家名称
// $tel=trim($_REQUEST[tel]);//商家电话
$alipay=trim($_REQUEST[alipay]);//支付宝账号
$alipay_name=trim($_REQUEST[aliname]);//支付宝收款人
$weipay=trim($_REQUEST[wechatpay]);//微信账号
$weipay_name=trim($_REQUEST[wechatname]);//微信收款人
$content=trim($_REQUEST[content]);//商家简介
//$phone=trim($_REQUEST[phone]);//登录账号
//$password=trim($_REQUEST[password]);//密码
$start_price=trim($_REQUEST[start_price]);//起送价格
$distribution_fee=trim($_REQUEST[distribution_fee]);//配送费
$song_da=trim($_REQUEST[song_da]);//送达时间
$qq=trim($_REQUEST[qq]);
$huodong_miaoshu=trim($_REQUEST[huodong_miaoshu]);
$isKuaigou=trim($_REQUEST[isKuaigou]);
$isHaitao=trim($_REQUEST[isHaitao]);
$kgfanquan=trim($_REQUEST[kgfanquan]);
$htfanquan=trim($_REQUEST[htfanquan]);
$kgservice=trim($_REQUEST[kgservice]);
$htservice=trim($_REQUEST[htservice]);
$freight_ins=trim($_REQUEST[freight_ins]);
$licence=trim($_REQUEST[licence]);
$flag = true;
// tel='".$tel."',
$sql = "UPDATE shop set licence='".$licence."',zileimu='".$zileimu."',qq='".$qq."',huodong_miaoshu='".$huodong_miaoshu."',isKuaigou='".$isKuaigou."',isHaitao='".$isHaitao."',kgfanquan='".$kgfanquan."',htfanquan='".$htfanquan."',kgservice='".$kgservice."',htservice='".$htservice."',freight_ins='".$freight_ins."',name='".$name."',alipay='".$alipay."',alipay_name='".$alipay_name."',weipay='".$weipay."',weipay_name='".$weipay_name."',content='".$content."',start_price='".$start_price."',distribution_fee='".$distribution_fee."',song_da='".$song_da."' where shopid=".$shopid;
//var_dump($sql);
$mysql->query($sql);

if ($_FILES) {
  $UpFileTool=new UpFileTool('upfile');
  $UpFileTool->sumbImage($w=600, $h=250 ,$sumbimage='../../sumbimage');
  $UpFileTool->upFile($srcimage='../../srcimage');
  $images = substr($UpFileTool->sumbImage,6);
  $srcimages = substr($UpFileTool->srcImage,6);

  $sql = "UPDATE shop set images='".$images."',srcimages='".$srcimages."' where shopid=".$shopid;
  $mysql->query($sql);
}
$arr = array('status' =>100);


echo json_encode($arr);